{template header}

{template sidebar}

<!-- artile begin -->
<div class="article">

    {template title}
    <!--{if  $a == 'index'}-->
    <form class="form-search" action="{$this->url($c, null, $this->get())}">
        <table>
            <tr><td class="td1" width="20%">旺旺ID：</td>
                <td>

                    <div class="input-append">
                        <input type="text" name="key" class="span2 search-query" placeholder="请输入旺旺ID" />
                        <button type="button" class="btn search">搜索</button>
                    </div>
                </td >
            </tr>
        </table>

    </form>
    <table cellpadding="1" cellspacing="1" border="0" width="100%">




        <tr>
            <th width="15%">旺旺ID</th>
            <th width="20%">姓名</th>
            <th width="15%">QQ</th>
            <th width="15%">Email</th>
            <th width="15%">操作</th>
        </tr>

        <!--{if $result}-->
        <!--{loop $result $v}-->
        <tr>
            <td>{$v['wwId']}</td>
            <td>{$v['name']}</td>
            <td>{$v['qq']}</td>
            <td>{$v['email']}</td>
            <td class="operate">
                <a href="{$this->url($c,'edit',array('id'=>$v['id']))}">编辑</a>
                <a title="删除" class="del" href="{$this->url($c,'del',array('id'=>$v['id']))}">删除</a>
            </td>
        </tr>
        <!--{/loop}-->

        <!--{else}-->
        <tr>
            <td colspan="6">没有记录!</td>
        </tr>
        <!--{/if}-->

        <!--{if $pager}-->
        <!--分页开始-->
        <tr>
            <td colspan="6">
                <div class="page">{$pager}</div>
            </td>
        </tr>
        <!--分页结束-->
        <!--{/if}-->
        <tr>
            <td colspan="4" class="td4">
                <a title="添加顾客" class="btn btn-success " href="{$this->url($c,'add',$result['id'])}">添加顾客</a>
            </td>
        </tr>



    </table>
    <!--{/if}-->

    <!--{if  $a == 'edit' || $a == 'add'}-->
    <form method="post" action="{$this->url($c, 'save', array('id' => $result['id']))}">
        <table cellpadding="1" cellspacing="1" border="0" width="100%">
            <tr>
                <td class="td1" width="30%">旺旺ID：</td>
                <td class="td2 operate">
                    <!-- class="required" 必填字段  -->
                    <input type="text" size="30" name="wwId" placeholder="请输入旺旺ID" class="required" value="{$a == 'edit' ? $result['wwId'] : ''}" />

                </td>
                <td class="operate">
                    <a href="{$this->url($c,'addChildren',array('wwId'=>$val['wwId'], 'type'=>'inStock'))}">添加小孩信息</a>
                    <a href="{$this->url($c,'lookChildren',array('wwId'=>$val['wwId'], 'type'=>'inStock'))}">查看小孩信息</a>
                </td>
            </tr>
            <tr>
                <td class="td1" width="30%">姓名：</td>
                <td class="td2">
                    <!-- class="required" 必填字段  -->
                    <input type="text" size="30" name="name" placeholder="请输入姓名" class="required" value="{$a == 'edit' ? $result['name'] : ''}" />
                </td>
            </tr>

            <tr>
                <td class="td1">电话：</td>
                <td class="td2">
                    <input type="text" size="30" name="mobile" placeholder="请输入电话" value="{$a == 'edit' ? $result['mobile'] : ''}" />
                </td>
            </tr>

            <tr>
                <td class="td1">QQ：</td>
                <td class="td2">
                    <input type="text" size="30" name="qq" placeholder="请输入QQ" value="{$a == 'edit' ? $result['qq'] : ''}" />
                </td>
            </tr>

            <tr>
                <td class="td1">Email：</td>
                <td class="td2">
                    <input type="text" size="30" name="email" placeholder="请输入Email" value="{$a == 'edit' ? $result['email'] : ''}" />
                </td>
            </tr>

            <tr>
                <td class="td1">Age：</td>
                <td class="td2">
                    <input type="text" size="30" name="age" placeholder="请输入Age" value="{$a == 'age' ? $result['address'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">所在地：</td>
                <td class="td2">
                    <input type="text" size="30" name="location" placeholder="请输入所在地" value="{$a == 'edit' ? $result['location'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">收件地址：</td>
                <td class="td2">
                    <input type="text" size="30" name="receiveAddress" placeholder="请输入收件地址：" value="{$a == 'edit' ? $result['receiveAddress'] : ''}" />
                </td>
            </tr>

            <tr>
                <td  class="td1">
                    <a title="保存" class="btn btn-success save" href="{$this->url($c)}">保 存</a>
                </td>
                <td  class="td1">
                    <a title="重置" class="btn btn-success save" href="{$this->url($c)}">重 置</a>
                </td>


            </tr>



        </table>
    </form>
    <!--{/if}-->

    <!--{if  $a == 'addChildren' || $a == 'editChildren'}-->
    <form method="post" action="{$this->url($c, 'saveChildren', array('id' => $result['id']))}">
        <table cellpadding="1" cellspacing="1" border="0" width="100%">
            <tr>
                <td class="td1">姓 名：</td>
                <td class="td2" colspan="3">
                    <input type="text" size="30" name="name" placeholder="请输入出生日期" value="{$a == 'editChildren' ? $result['name'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">昵称：</td>
                <td class="td2" colspan="3">
                    <input type="text" size="30" name="loveName" placeholder="请输入出生日期" value="{$a == 'editChildren' ? $result['loveName'] : ''}" />
                </td>
            </tr>

            <tr>
                <td class="td1">出生日期：</td>
                <td class="td2" colspan="3">
                    <input type="text" size="30" name="birthday" placeholder="请输入出生日期" value="{$a == 'editChildren' ? $result['birthday'] : ''}" />
                </td>
            </tr>
            <tr>
                <td class="td1">性别：</td>
                <td class="td2" colspan="3">
                    <input type="text" size="30" name="gender" placeholder="请输入性别：" value="{$a == 'editChildren' ? $result['gender'] : ''}" />
                </td>
            </tr>
            <tr>
                <td colspan="2" class="td1">
                    <a title="保存" class="btn btn-success save" href="{$this->url($c)}">保 存</a>
                </td>
                <td colspan="2" class="td1">
                    <a title="重置" class="btn btn-success save" href="{$this->url($c)}">重置</a>
                </td>
            </tr>

        </table>
    </form>
    <!--{/if}-->

    <!--{if  $a == 'lookChildren' }-->
    <table cellpadding="1" cellspacing="1" border="0" width="100%">
        <tr>
            <th width="5%"><input type="checkbox" class="all" /></th>
            <th width="20%">姓名</th>
            <th width="15%">昵称</th>
            <th width="15%">出生日期</th>
            <th width="15%">性别</th>
            <th width="15%">操作</th>
        </tr>

        <!--{if $result}-->
        <!--{loop $result $v}-->
        <tr>
            <th width="5%"><input type="checkbox" class="all" /></th>
            <td>{$v['name']}</td>
            <td>{$v['loveName']}</td>
            <td>{$v['birthday']}</td>
            <td>{$v['gender']}</td>
            <td class="operate">
                <a href="{$this->url($c,'editChildren',array('id'=>$v['id']))}">编辑</a>
                <a title="删除" class="del" href="{$this->url($c,'del',array('id'=>$v['id']))}">删除</a>
            </td>
        </tr>
        <!--{/loop}-->

        <!--{else}-->
        <tr>
            <td colspan="6">没有记录!</td>
        </tr>
        <!--{/if}-->

        <!--{if $pager}-->
        <!--分页开始-->
        <tr>
            <td colspan="6">
                <div class="page">{$pager}</div>
            </td>
        </tr>
        <!--分页结束-->
        <!--{/if}-->




    </table>
    <!--{/if}-->

</div>
<!-- artile end -->
{template footer}